package com.etsmtl.log320.sudo;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;

import javax.swing.JFrame;

public class SolveActionListener implements ActionListener{
	private SudoFrame m_Frame;
	public SolveActionListener(SudoFrame myFrame){
		m_Frame = myFrame;
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		
		System.out.println("Solver1:");
		SudokuSolver solver1 = new SudokuSolver(SudoFileManager.readFile(m_Frame.getSourceFileText()), m_Frame.getStrategy());
		solver1.solve();
		
		/*
		System.out.println("Solver2:");
		SudokuSolver solver2 = new SudokuSolver(SudoFileManager.readFile(m_Frame.getSourceFileText()), m_Frame.getStrategy());
		solver2.solve();
		
		System.out.println("Solver3:");
		SudokuSolver solver3 = new SudokuSolver(SudoFileManager.readFile(m_Frame.getSourceFileText()), m_Frame.getStrategy());
		solver3.solve();
		
		System.out.println("Solver4:");
		SudokuSolver solver4 = new SudokuSolver(SudoFileManager.readFile(m_Frame.getSourceFileText()), m_Frame.getStrategy());
		solver4.solve();
		
		System.out.println("Solver5:");
		SudokuSolver solver5 = new SudokuSolver(SudoFileManager.readFile(m_Frame.getSourceFileText()), m_Frame.getStrategy());
		solver5.solve();
		*/
		
		//SudoFileManager.writeFile(m_Frame.getOutFileText(), fileContent);
	}
}
